package cn.iocoder.yudao.module.personal.dal.mysql.notetag;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.personal.dal.dataobject.notetag.NoteTagDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.personal.controller.admin.notetag.vo.*;

/**
 * 笔记标签 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface NoteTagMapper extends BaseMapperX<NoteTagDO> {

    default PageResult<NoteTagDO> selectPage(NoteTagPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<NoteTagDO>()
                .eqIfPresent(NoteTagDO::getTitle, reqVO.getTitle())
                .eqIfPresent(NoteTagDO::getContent, reqVO.getContent())
                .eqIfPresent(NoteTagDO::getUrl, reqVO.getUrl())
                .eqIfPresent(NoteTagDO::getType, reqVO.getType())
                .eqIfPresent(NoteTagDO::getLevel, reqVO.getLevel())
                .eqIfPresent(NoteTagDO::getYlzd1, reqVO.getYlzd1())
                .eqIfPresent(NoteTagDO::getYlzd2, reqVO.getYlzd2())
                .eqIfPresent(NoteTagDO::getYlzd3, reqVO.getYlzd3())
                .eqIfPresent(NoteTagDO::getYlzd4, reqVO.getYlzd4())
                .eqIfPresent(NoteTagDO::getYlzd5, reqVO.getYlzd5())
                .eqIfPresent(NoteTagDO::getYlzd6, reqVO.getYlzd6())
                .eqIfPresent(NoteTagDO::getMemo, reqVO.getMemo())
                .betweenIfPresent(NoteTagDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(NoteTagDO::getId));
    }

}